package com.carkeeper.appraise.listener;

import com.carkeeper.appraise.config.RabbitMQConfig;
import com.carkeeper.appraise.service.AppraisalService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DelListener {

    @Autowired
    private AppraisalService appraisalService;

    @RabbitListener(queues = RabbitMQConfig.DEL_APPRAISAL_QUEUE)
    public void getMessage(String message){
        try {
            appraisalService.del(message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
